﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Khaibaoungvienhoanthanhkhoahuanluyen.ascx.cs" Inherits="WebUserControl_Khaibaoungvienhoanthanhkhoahuanluyen" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>

<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />



<script type="text/javascript">
     function pageLoad() {
     
     $(function()
     {
	    $("#<%= Txt_ngay.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});

$("#<%= btChon.ClientID %>").click(function () {
    $.blockUI({
        message: '<h1>Xin vui lòng chờ xử lý</h1>',
        css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#f00',
            opacity: .5,
            color: '#fff'
        }
    });
}); 

      $("#<%= bt_luu.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
       
     
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                    }

        }
        function SelectAllCheckboxes(spanChk) {

            // Added as ASPX uses SPAN for checkbox

            var oItem = spanChk.children;
            var theBox = (spanChk.type == "checkbox") ?
        spanChk : spanChk.children.item[0];
            xState = theBox.checked;
            elm = theBox.form.elements;

            for (i = 0; i < elm.length; i++)
                if (elm[i].type == "checkbox" &&
              elm[i].id != theBox.id) {
                    //elm[i].click();

                    if (elm[i].checked != xState)
                        elm[i].click();
                    //elm[i].checked=xState;

                }
        }   
</script> 
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <fieldset>
    <legend>Khai báo BA hoàn thành khóa huấn luyện</legend>
    
      <div class="fm-req">
           <label for="txtMaTuVanVien">Khóa huấn luyện:</label>
           <asp:DropDownList ID="Drl_khoahuanluyen" runat="server" TabIndex="3" 
                                Width="150px">
           </asp:DropDownList>
      </div>
      <div class="fm-req">
           <label for="txtMaTuVanVien">Ngày huấn luyện:</label>
           <asp:TextBox ID="Txt_ngay" runat="server" TabIndex="5" Width="110px"></asp:TextBox>
      </div>
      <div class="fm-req">
           <label for="txtMaTuVanVien">Người huấn luyện:</label>
           <asp:TextBox ID="txt_Nguoihuanluyen" runat="server" TabIndex="8" Width="210px"></asp:TextBox>
      </div>
       <div class="fm-req">
           <label for="txtMaTuVanVien">BA hoàn thành:</label>
           <asp:TextBox ID="txtBA" runat="server" TabIndex="8" Width="110px"></asp:TextBox>
            <asp:Button ID="btChon" runat="server" Text="Chọn" Width="100px"  TabIndex="13" 
            onclick="btChon_Click" /> 
      </div>
      
        &nbsp;<asp:Button ID="bt_luu" runat="server" Text="Lưu" Width="100px" onclick="bt_luu_Click" TabIndex="13" /> 
     
    </fieldset>
                 <br />
                           
                                <asp:GridView ID="gv_tuvanvien" runat="server" AutoGenerateColumns="False" 
                                    CellPadding="4" ForeColor="#333333" 
            GridLines="None" Height="160px" 
                                    Width="500px" PageSize="12" TabIndex="12" 
            EnableModelValidation="True">
                                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Chọn">
                                        <HeaderTemplate>
                                         <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" 
                                            runat="server" type="checkbox" />
                                        </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1"   runat="server"/>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                            </EditItemTemplate>
                                            <HeaderStyle Height="24px" Width="15%" />
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="Mã BA" DataField="salesp_key" >
                                            <HeaderStyle Width="100px" />
                                        </asp:BoundField>
                                        <asp:BoundField HeaderText="Họ Tên BA" DataField="salesp_name" >
                                            <HeaderStyle Width="300px" />
                                        </asp:BoundField>
                                    </Columns>
                                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                       
        
  </ContentTemplate>
  
</asp:UpdatePanel>  
 <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />

   



  

   

